

<!DOCTYPE html>
<html>

<head>
   
    
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!--360浏览器优先以webkit内核解析-->


<title>费用申请明细</title>
    <script src="__STATIC__/layout/js/jquery.min.js"></script>
<link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
<link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
<link href="__STATIC__/layout/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
<!--<link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">-->
<link href="__STATIC__/layout/css/channel.css?v=4.1.0" rel="stylesheet">
<!-- Sweet Alert -->

<link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<!--<link href="__STATIC__/layout/js/plugins/select/bootstrap-select.css" rel="stylesheet">-->


    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link href="__STATIC__/xds/js/select2/css/select2.css" rel="stylesheet" />
    <script src="__STATIC__/xds/js/select2/js/select2.js"></script>
    <style>
        .hover{
            display: block;
            width: 80px;
            line-height: 30px;
            height: 30px;
            overflow: hidden;
            position: relative;
        }
        .hover:hover{
            overflow: visible;
        }
        .hover .ex{
            position: absolute;
            left: 80px;
            top: 0;
            width: 200px;
            line-height: 60px;
            background: #ff0;
            text-align: center;
        }
    </style>
    <style>
        #form1 p{
            line-height: 20px;
            padding: 4px;
        }
        .titleImg{
            width: 20px;
            height: 20px;
            margin-right: 8px;
            display: inline-block;
            vertical-align: middle;
        }
        .table{
            margin-bottom: 10px;
        }
          .handup{
            color: #a6e1fc;
            display: inline-block;
            padding-left: 10px;
            cursor: pointer;
        }
         .btn-white.active{
            color: #fff;
            background-color: #337ab7;
        }
        .bootstrap-select{
            height: 36px;
            border-radius: 6px;
        }
        .bootstrap-select .btn-default {
             border-radius: 6px;
             background-color: #fff; 
             border-color: #c2c2c2; 
             color: #333; 
            }
        .btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default{
            border-radius: 6px;
             background-color: #fff; 
             border-color: #c2c2c2; 
             color: #333; 
         }
    </style>

</head>

<body class="white-bg" style="padding: 3px;font-size: 13px">
    <div class="page-heade">
       <h2 class="title_color text-center">费用申请明细</h2>
    </div>
    <form action="" class="form-inline" id="form1">
        <p><img  class="titleImg" src="__STATIC__/layout/img/activityXiTong.png" alt=""><b>基本信息</b></p>
        <table class="table table-bordered bud_hei">
            <thead>
                <tr class="info">
                    <th class="text-center">活动期间</th>
                    <th class="text-center">预算期间</th>
                    <th class="text-center">预计核销日期</th>
                    <th class="text-center">活动简述及目的</th>
                    <th class="text-center">所属专项方案</th>
                </tr>
            </thead>
            <tbody>
                <tr class="text-center">
                    <td><input type="text" id="actiontime" class="form-control layer-icon" style="width: 60%" placeholder="开始时间 至 结束时间">&nbsp;&nbsp;<span class="text-danger" id="actionText"></span></td>
                    <td><input type="text" id="yusuantime" class="form-control" style="width: 80%" placeholder="开始时间 至 结束时间"></td>
                    <td><input type="text" id="yujihexiaotime" class="form-control"></td>
                    <td><input type="text" class="form-control" style="width: 95%"></td>
                    <td>无</td>
                </tr>
            </tbody>
        </table>
         <p><img  class="titleImg" src="__STATIC__/layout/img/activityXiTong.png" alt=""><b>费用详情</b></p>
        <table class="table table-bordered bud_hei">
            <thead>
                <tr class="info">
                    <th class="text-center">费用类型</th>
                    <th class="text-center">支付方式</th>
                    <th class="text-center">未税总额</th>
                    <th class="text-center">收款方</th>
                    <th class="text-center">成本中心</th>
                    <th class="text-center">费用说明</th>
                    <th class="text-center">
                        <button class="btn btn-success " type="button"><i class="fa fa-plus-square"></i>&nbsp;&nbsp;<span class="bold">添加</span>
                        </button>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <script src="__STATIC__/xds/js/select.js"></script>
                    <td   id="FeiYonglx"   ></td>
                    <script>
                        function mu(type) {
                            if(type==1){
                                $('#myModal1').modal('show');
                            }else {
                                alert(1);
                            }
                        }
                        entranceX('FeiYonglx',
                            "{:url('BiHaiChaoSheng/AjaxFYKU',['esuseway'=>'2','channeltypes'=>$channeltype])}",
                            '{:url("BiHaiChaoSheng/selectList",["str"=>"FeiYonglx","url"=>"Tifykm","where"=>"esuseway_2__channeltypes_$channeltype"])}',
                            '',function () {
                                if($("input[name=FeiYonglx]").val()==''){
                                    $('#isNull').nextAll().remove();
                                }else {
                                    var FeiYonglxVal = $("input[name=FeiYonglx]").val();
                                    var FeiYonglxUrl = "{:url('BiHaiChaoSheng/get3KmDyfkfs')}?id="+FeiYonglxVal;
                                    $.ajax({
                                        url: FeiYonglxUrl,
                                        type: 'get',
                                        
                                        dataType: 'json',
                                        success: function(data) {
                                            if(data.code==200){
                                                var zi = '';
                                                var value = data.value;
                                                for (var i =0;i<value.length;i++){

                                                    zi+='<option method="'+value[i].method+'" onclick="mu('+value[i].method+')"  value="'+value[i].id+'">'+value[i].title+'</option>';
                                                }


                                                $('#isNull').after(zi);
                                            }
                                        }
                                    })

                                }
                            });
                    </script>
                    <td>
                        <!--<select name="cal" id="cal" class="form-control select"  disabled="true" style="    padding: 2px 10px;">-->
                            <!--<option value="0">请选择</option>-->
                            <!--<option value="1">请选择2</option>-->
                        <!--</select>-->
                        <select name="status" id="state" class="form-control select" style="min-width: 100px;width: 100px;padding: 2px 10px;">
                            <option id="isNull">请选择</option>

                        </select>
                    </td>
                    <td>
                       <div class="input-group">
                        <input type="text" class="form-control" aria-label="RMB" style="width: 60px;height: 30px">
                         <span class="input-group-addon">元</span>
                         
                        </div>
                        <a href="javascript:;" data-toggle="modal" id="xgcbzx" data-target="" style="display: inline-block;">
                        <span class="fa fa-eyedropper"  style="cursor: pointer;" data-toggle="tooltip" data-placement="right" title="修改成本中心"></span></a>
                        <script>
$('#xgcbzx').on('click',function () {
    $('#myModal1').modal('show');

});

                        </script>
                    </td>
                    <td>
                      <div class="btn-group">
                    <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="options" id="agency" autocomplete="off" style="opacity: 0;position: absolute;">经销商
                     </label>
                     <label class="btn btn-white active" style="position: relative;">
                         <input type="radio" name="options" id="gys" autocomplete="off" checked style="opacity: 0;position: absolute;"> 供应商
                     </label>
                 </div><br><br>
                    <input type="text" class="form-control" name="" id="gysInput">
                    </td>
                    <td>
                        <div class="form-group" style="width: 60%" id="showSelectText">
                            <p><span >东南大区</span>，100%</p>
                            <p><span>东南大区</span>，100%</p>
                            <p><span>东南大区</span>，100%</p>
                        </div><a href="javascript:;" data-toggle="modal" data-target="#myModal" style="line-height: 1;display: inline-block;vertical-align: bottom;">
                        <span class="fa fa-eyedropper" style="cursor: pointer;vertical-align: bottom;margin-bottom: 8px" data-toggle="tooltip" data-placement="right" title="修改成本中心"></span></a>
                    </td>
                    <td><input type="text" class="form-control" id="" style="width: 100%" placeholder="简要说明费用构成"></td>
                    <td>
                        <a class="btn btn-white btn-bitbucket">
                            <i class="fa fa-trash-o"></i> 删除
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
         <p style=""><img  class="titleImg" src="__STATIC__/layout/img/activityXiTong.png" alt=""><b>客户详情</b>&nbsp;&nbsp;&nbsp;
                    <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="options1" id="angencyr" autocomplete="off" style="opacity: 0;position: absolute;">经销商
                     </label>
                     <label class="btn btn-white active" style="position: relative;">
                         <input type="radio" name="options1" id="sysr" autocomplete="off" checked style="opacity: 0;position: absolute;"> 系统
                     </label>
                      <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="options1" id="netr" autocomplete="off" checked style="opacity: 0;position: absolute;"> 网点
                     </label>
         </p>
        <table class="table table-bordered bud_hei" id="angencyTable" style="display: none;">
            <tr>
                <td><b>长沙市骏鸿实业有限公司</b></td>
            </tr>
        </table>
         <table class="table table-bordered bud_hei" id="netTable" style="display: none;">
            <tr>
                <td>
                     <div class="input-group form-group" id="WangDian" style="display: inline-block;" >

                    </div>
                 <script>
                     entranceX('WangDian',
                         "{:url('BiHaiChaoSheng/AjaxWD',['jxs'=>$channeltype])}",
                         '{:url("BiHaiChaoSheng/selectList",["str"=>"WangDian","url"=>"Tiwd","where"=>"jxs_$channeltype"])}',
                         '',
                         '');
                 </script>
                </td>
            </tr>
        </table>
        <table class="table table-bordered bud_hei" id="sysTable" >
            <thead>
                <tr class="info">
                    <th class="text-center">系统</th>
                    <th class="text-center">费用占比</th>
                    <th class="text-center">预计投放网点数</th>
                    <th class="text-center">
                        <button class="btn btn-success " type="button"><i class="fa fa-plus-square"></i>&nbsp;&nbsp;<span class="bold">添加</span>
                        </button>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr class="text-center">
                    <td>
                        <div class="input-group form-group" id="JinXiaoShang" style="display: inline-block;" id="selectDivangency1">


                        </div>
                        <script>
                            entranceX('JinXiaoShang',
                                "{:url('BiHaiChaoSheng/AjaxJXS',['jxs'=>$channeltype])}",
                                '{:url("BiHaiChaoSheng/selectList",["str"=>"JinXiaoShang","url"=>"Tixt","where"=>"jxs_$channeltype"])}',
                                '',
                                '');
                        </script>

                    </td>
                    <td> 
                         <div class="input-group">
                        <input type="text" class="form-control" aria-label="" style="width: 60px;height: 30px">
                         <span class="input-group-addon">%</span>
                        </div>   
                    </td>
                     <td> 
                         <div class="input-group">
                        <input type="text" class="form-control" aria-label="" style="width: 60px;height: 30px">
                         <span class="input-group-addon">家</span>
                        </div>   
                    </td>
                    <td>
                         <a class="btn btn-white btn-bitbucket">
                            <i class="fa fa-trash-o"></i> 删除
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
         <p><img  class="titleImg" src="__STATIC__/layout/img/activityXiTong.png" alt=""><b>产品详情</b>&nbsp;&nbsp;&nbsp;
             <label class="btn btn-white active" style="position: relative;">
                         <input type="radio" name="option" id="brand" autocomplete="off" style="opacity: 0;position: absolute;" onclick="showTable($(this))">品牌
                     </label>
                     <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="option" id="pinlei" autocomplete="off" checked style="opacity: 0;position: absolute;"  onclick="showTable($(this))"> 品类
                     </label>
                      <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="option" id="list" autocomplete="off" checked style="opacity: 0;position: absolute;"  onclick="showTable($(this))"> 系列
                     </label>
                      <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="option" id="sku" autocomplete="off" checked style="opacity: 0;position: absolute;"  onclick="showTable($(this))"> SKU
                     </label>
                       <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="option" id="danpin" autocomplete="off" checked style="opacity: 0;position: absolute;"> 单品
                     </label>
                     <i id="proText">注：产品费用占比加起来必须等于100%,如果不填费用占比则平摊</i>
         </p>
        <table class="table table-bordered bud_hei" id="proTable">
            <thead>
                <tr class="info">
                    <th class="text-center">产品</th>
                    <th class="text-center">费用占比</th>
                    <th class="text-center">产品说明</th>
                    <th class="text-center"> <button class="btn btn-success " type="button"><i class="fa fa-plus-square"></i>&nbsp;&nbsp;<span class="bold">添加</span>
                        </button></th>
                </tr>
            </thead>
            <tbody>
                <tr class="text-center">
                    <td>
                        <div class="input-group form-group" style="display: inline-block;" id="selectDivangency1">
                                        <input type="text" value="4444" class="form-control" id="testNoBtn2">
                                        <div class="input-group-btn">
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                            </ul>
                                        </div>
                        </div>
                         <span class="fa fa-hand-o-up handup fa-2x"></span>
                    </td>
                    <td>
                         <div class="input-group">
                        <input type="text" class="form-control" aria-label="" style="width: 60px;height: 30px">
                         <span class="input-group-addon">%</span>
                        </div>
                    </td>
                    <td>
                        <input type="text" class="form-control" name="" id="" placeholder="简要说明产品">
                    </td>
                    <td>
                     <a class="btn btn-white btn-bitbucket">
                            <i class="fa fa-trash-o"></i> 删除
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
         <table class="table table-bordered bud_hei" id="danpinTable" style="display: none;">
            <thead>
                <tr class="info">
                    <th class="text-center">产品</th>
                    <th class="text-center">数量</th>
                    <th class="text-center">经销商特价</th>
                    <th class="text-center">产品说明</th>
                    <th class="text-center"> <button class="btn btn-success " type="button"><i class="fa fa-plus-square"></i>&nbsp;&nbsp;<span class="bold">添加</span>
                        </button></th>
                </tr>
            </thead>

            <tbody>
                <tr class="text-center">
                    <td>
                        <div class="input-group form-group" style="display: inline-block;" id="selectDivangency1">
                                        <input type="text" value="1111" class="form-control" id="testNoBtn2">
                                        <div class="input-group-btn">
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                            </ul>
                                        </div>
                        </div>
                         <span class="fa fa-hand-o-up handup fa-2x"></span>
                    </td>
                    <td style="text-align: center;">
                        <input type="text" class="form-control" name="" id="num" placeholder="">
                    </td>
                    <td>
                        <div>
                            <div class="" style="text-align: left;">
                                原供价:<input type="text" autocomplete="off"  disabled="disabled" id="oldprice0" style="width: 60px;">
                            </div>
                            <br>
                            <div class="" style="text-align: left;">
                                现供价:
                                <input type="text" autocomplete="off" id="nowprice0" style="width: 60px;" class="el-input__inner">
                            </div>
                            <br>
                            <div class="" style="text-align: left;">
                                折价率:
                                <input type="text" autocomplete="off" id="dealerZheJiaLv0" style="width: 60px;" class="el-input__inner">% OFF
                            </div>

                            <br> <div style="text-align: left; font-size: 12px; color: rgb(102, 102, 102); font-style: italic;">
                            顺加50.00% 倒扣33.33%
                            <a class="hover" href="#">
                                <span>帮助</span>
                                <div class="ex" style="width: 400px;height: 100px;">经销商的顺加毛利率 =（网点现供价 - 经销商现供价）/ 经销商现供价
                                    <br>
                                    经销商的倒扣毛利率 = （网点现供价 - 经销商现供价）/ 网点现供价</div>
                            </a>
                            <span><div role="tooltip" id="el-popover-2544" aria-hidden="true" class="el-popover el-popper" tabindex="0" style="display: none;">

	</div><span class="el-popover__reference" aria-describedby="el-popover-2544" tabindex="0" style="cursor: pointer;">


		</span>
		</span>
                        </div>
                        </div>
                    </td>
                    <td>
                        <input type="text" class="form-control" name="" id="sm" placeholder="简要说明产品">
                    </td>
                    <td>
                     <a class="btn btn-white btn-bitbucket">
                            <i class="fa fa-trash-o"></i> 删除
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
        <p><img  class="titleImg" src="__STATIC__/layout/img/activityXiTong.png" alt=""><b>销量预测</b>&nbsp;&nbsp;&nbsp;
             <label class="btn btn-white active" style="position: relative;">
                         <input type="radio" name="sallr" id="shejisall" autocomplete="off" checked style="opacity: 0;position: absolute;"> 涉及销量
                     </label>
                      <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="sallr" id="noshejisall" autocomplete="off" checked style="opacity: 0;position: absolute;"> 不涉及销量
                     </label>
        </p>
        <table class="table table-bordered bud_hei" id="sallycTable">
            <thead>
                <tr class="info">
                    <th class="text-center">预计销售类型</th>
                    <th class="text-center">不做活动销售额</th>
                    <th class="text-center">做活动销售额</th>
                    <th class="text-center">增量销售额</th>
                    <th class="text-center">申请费用额合计</th>
                    <th class="text-center">预计费用率</th>
                </tr>
            </thead>
            <tbody>
                <tr class="text-center">
                    <td>
                        <select name="" id="" class="form-control">
                            <option value="0">请选择</option>
                        </select>
                    </td>
                    <td>
                         <div class="input-group">
                        <input type="text" class="form-control" aria-label="RMB" style="width: 60px;height: 30px" >
                         <span class="input-group-addon">元</span>
                        </div>
                    </td>
                    <td>
                         <div class="input-group">
                        <input type="text" class="form-control" aria-label="RMB" style="width: 60px;height: 30px" >
                         <span class="input-group-addon">元</span>
                        </div>
                    </td>
                    <td></td>
                    <td class="text-right">2321.3元</td>
                    <td class="text-right"></td>
                </tr>
            </tbody>
        </table>
   
<div class="modal fade" tabindex="-1" role="dialog" id="myModal" aria-labelledby="gridSystemModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" style="font-size: 16px">&times;</span></button>
        <h2 class="modal-title" id="gridSystemModalLabel">成本中心2</h2>
      </div>
     
      <div class="modal-body" style="position: relative;min-height: 400px;height: auto;">
          <div class="control-group" >



              <select class="selectpicker show-menu-arrow" id="multiples" style="width:100% ">

              </select>
                <script>
                    function setSelect(){
                        var strtext = $('#multiples').select2('data');
                        console.log(strtext);
                        var a=[];
                        // console.log(typeof(a))
                        for(var i=0;i<strtext.length;i++){
                           a[strtext[i].id] = strtext[i].text;

                        }
                        var b=[];
                        $("#selectDiv .divTid").each(function(){
                            b[$(this).attr('tid')]=$(this).find('.inpbai').val();
                        })
                        var str = '' ;
                        o = 0;
                        for(key in a){
                          o++;
                          if(b.hasOwnProperty(key)){
                             str += '<div class="padding-10 divTid" tid="'+key+'">'+
                                '<div class="form-group"><input class="tid" type="hidden" value="'+key+'"/>'+o+'.<span class="uiName">'+a[key]+'</span></div>'+
                                '<div class="form-group" style="float: right;">'+
                                    '<div class="input-group">'+
                                    '<input type="text" class="form-control inpbai" aria-label="%" style="width: 60px;height: 30px" value="'+b[key]+'" >'+
                                     '<span class="input-group-addon">%</span>'+
                                    '</div>'+
                                '</div>'+
                            '</div>';
                          }else{
                           str += '<div class="padding-10 divTid" tid="'+key+'">'+
                               '<div class="form-group"><input class="tid" value="'+key+'" style="display: none"/>'+o+'.<span class="uiName">'+a[key]+'</span></div>'+
                                '<div class="form-group" style="float: right;">'+
                                    '<div class="input-group">'+
                                    '<input type="text" class="form-control inpbai" aria-label="%" style="width: 60px;height: 30px" value="" >'+
                                     '<span class="input-group-addon">%</span>'+
                                    '</div>'+
                                '</div>'+
                            '</div>';
                          }
                        }

                        $("#selectDiv").html(str);
                    }
                    $(document).ready(function() {
                        //$('.js-example-basic-single').select2();
                       var multiples =  $("#multiples").select2({
                            placeholder: "",
                            allowClear: true,
                            multiple: true,
                            data: [{id: 10001, text: '东南大区'},
                                {id: 10002, text: '西北大区'},
                                {id: 10003, text: '华东大区'},
                                {id: 10004, text: '华北大区'},
                                {id: 10005, text: '北方大区'},
                                ]
                        }).on("change",function(){
                            setSelect();

                        });
                  
                    
                    $("#multiples").val([10001,10003]).trigger('change');
                    setSelect();
                    });
                </script>
                <div class="padding-10" id="selectDiv">
                </div>
                <p class="alert alert-warning" style="position: absolute;bottom: 0;left: 5px;padding: 5px;width: 95%;box-sizing: border-box;">
                    占比加起来必须等于100%
                </p>
      </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" onclick="tijiao()" id class="btn btn-primary">保存</button>
          <script>
              function tijiao() {


              var l = '';
              var m = 0;
              var sum = 0;
                  $('.divTid').each(function () {

                      sum += Number($(this).find('.inpbai').val());
                  });
                  if(sum!=100){m =2;};
              $('.divTid').each(function () {

                      if($(this).find('.inpbai').val()==''||$(this).find('.inpbai').val()==0){

                          var z =  $(this).find('.uiName').text();

                          if(l==''){
                              l += z;
                          }else {
                              l += ','+ z;
                          }
                          m = 1;
                      }

              });
              if(m==1){
                  swal('',l+'，请填写占比！','warning');
              }else if(m==2){
                  swal('','占比加起来必须等于100%！','warning');
              }else {
                  alert('提交成功');
                  $("#myModal").modal('hide');

                  var str2= '';
                   $('.divTid').each(function () {
                    var uiName=$(this).find('.uiName').text();
                    var  tid = $(this).find('.uiName').siblings('input').attr('tid');
                    var inpbai=$(this).find('.inpbai').val()
                     str2 += '<p class="psClassName" psid="'+tid+'" psTo="'+inpbai+'"><span>'+uiName+'</span>,'+inpbai+'%</p>'
                    });
                    $("#showSelectText").html(str2);
                 }
              }
          </script>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="myModal1" aria-labelledby="gridSystemModalLabel">
  <div class="modal-dialog  modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" style="font-size: 16px">&times;</span></button>
        <h2 class="modal-title" id="SystemModalLabel">样品物料</h2>
      </div>
     
      <div class="modal-body" style="position: relative;min-height: 400px;height: auto;">
         <table class="table-bordered table-hover table text-center" id="ywTable">
            <thead>
                <tr class="info">
                    <th class="text-center">类型</th>
                    <th class="text-center">样品/物料</th>
                    <th class="text-center">数量</th>
                    <th class="text-center">单位</th>
                    <th class="text-center">单价</th>
                    <th class="text-center">金额(元)</th>
                    <th class="text-center"><button class="btn btn-success" id="addyw" type="button"><i class="fa fa-plus-square"></i>&nbsp;&nbsp;<span class="bold">添加</span>
                        </button></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                  <td>
                    <div class="btn-group" style="border: 1px solid #ccc;border-radius: 6px;">
                    <label class="btn btn-white" style="position: relative;">
                         <input type="radio" name="options" id="option1" autocomplete="off" style="opacity: 0;position: absolute;">进货
                     </label>
                     <label class="btn btn-white active" style="position: relative;">
                         <input type="radio" name="options" id="option2" autocomplete="off" checked style="opacity: 0;position: absolute;"> 不进货
                     </label>
                 </div>
                  </td>
                  <td>
                    <input type="text" class="form-control">
                  </td>
                  <td><input type="text" class="form-control" style="width: 80px"></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td>
                    <a class="btn btn-danger btn-bitbucket del_this">
                            <i class="fa fa-trash-o"></i> 删除
                    </a>
                  </td>
                </tr>
            </tbody>
         </table>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary">保存</button>
         
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div>
 </form>
<!-- 全局js -->

<script src="__STATIC__/layout/js/contabs_sub.js"></script>

<!-- Sweet alert -->
<script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
 <script src="__STATIC__/layout/js/plugins/laydate/laydate.js"></script>

   <!--<script type="text/javascript" src="__STATIC__/layout/js/plugins/select/bootstrap-select.js"></script> -->
    <!-- Chosen -->
    <script src="__STATIC__/layout/js/plugins/chosen/chosen.jquery.js"></script>

<script>

 
    $(function () {
        $('body').on('click','input[type=text]',function () {
            this.select()
        })
    })
</script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script>
  $(function () {
            $('[data-toggle="tooltip"]').tooltip()
    })
   laydate.render({
    elem: '#actiontime',
    type: 'date',
    range: '至',
    done: function(value, date){
    var thisVal = value.split("至");
    var sta_str = new Date(thisVal[0]);
    var end_str = new Date(thisVal[1]);
    var num = (end_str-sta_str)/(1000*3600*24)
    $("#actionText").text(num+"天");
  }
    });
    laydate.render({
    elem: '#yusuantime',
    type: 'date',
    range: '至',
    });
     laydate.render({
    elem: '#yujihexiaotime',
    type: 'date'
    });
    

  $("#selectDivangency1").css("width","60%");


  /*经销商or供应商*/
  $("#agency").click(function(){
        // console.log(1)
     $(this).parent('label').siblings().removeClass('active')
     $(this).parent('label').addClass('active')
     $("#gysInput").hide();
})
$("#gys").click(function(){
     $(this).parent('label').siblings().removeClass('active')
     $(this).parent('label').addClass('active');
      $("#gysInput").show();
})

/*经销商or系统or网点*/
$("#angencyr").click(function(){
        // console.log(1)
     $(this).parent('label').siblings('label').removeClass('active')
     $(this).parent('label').addClass('active')
     $("#angencyTable").show();
     $("#sysTable").hide();
     $("#netTable").hide();
})
$("#sysr").click(function(){
        // console.log(1)
     $(this).parent('label').siblings('label').removeClass('active');
     $(this).parent('label').addClass('active');
     $("#angencyTable").hide();
     $("#sysTable").show();
     $("#netTable").hide();
     
})
$("#netr").click(function(){
        // console.log(1)
     $(this).parent('label').siblings('label').removeClass('active')
     $(this).parent('label').addClass('active')
     $("#angencyTable").hide();
     $("#sysTable").hide();
     $("#netTable").show();
})



$("#danpin").click(function(){
     $(this).parent('label').siblings('label').removeClass('active')
     $(this).parent('label').addClass('active');
     $("#proTable").hide();
     $("#danpinTable").show();
     $("#proText").text("注：如选择单品类，则各单品费用将会平摊，如不希望平摊，请填写多次明细")
})


function showTable(obj){
    obj.parent('label').siblings('label').removeClass('active')
    obj.parent('label').addClass('active');
     $("#proTable").show();
     $("#danpinTable").hide();
     $("#proText").text("注：产品费用占比加起来必须等于100%,如果不填费用占比则平摊");
}


/*销量预测*/
$("#shejisall").click(function(){
     $(this).parent('label').siblings('label').removeClass('active')
     $(this).parent('label').addClass('active');
     $("#sallycTable tbody tr td").find('input').attr('disabled',false);
     $("#sallycTable tbody tr td").find('select').attr('disabled',false);
})
$("#noshejisall").click(function(){
    $(this).parent('label').siblings('label').removeClass('active')
     $(this).parent('label').addClass('active');
     $("#sallycTable tbody tr td").find('input').attr('disabled',true);
     $("#sallycTable tbody tr td").find('select').attr('disabled',true);
})





</script>


<script>
/*样品or物料*/
var num=1,abc=3;




$("#addyw").click(function(){
    var date= Date.parse(new Date())
    
    var str='<tr>'+
            '<td>'+
            '<div class="btn-group" style="border: 1px solid #ccc;border-radius: 6px;">'+
                '<label class="btn btn-white" style="position: relative;">'+
                      '<input type="radio" name="options" id="option'+date+'" '+
                      'autocomplete="off" style="opacity: 0;position: absolute;">进货'+
                     '</label>'+
                     '<label class="btn btn-white active" style="position: relative;">'+
                        '<input type="radio" name="options" id="option2'+date+'" autocomplete="off" checked style="opacity: 0;position: absolute;"> 不进货'+
                     '</label>'+
                 '</div>'+
                  '</td>'+
                  '<td>'+
                    '<input type="text" class="form-control">'+
                  '</td>'+
                  '<td><input type="text" class="form-control" style="width: 80px"></td>'+
                  '<td></td>'+
                  '<td></td>'+
                  '<td></td>'+
                  '<td>'+
                    '<a class="btn btn-danger btn-bitbucket del_this">'+
                            '<i class="fa fa-trash-o"></i> 删除'+
                    '</a>'+
                  '</td>'+
                '</tr>'
    $("#ywTable").append(str)
})
$(document).on("click","input[name=options]",function(){
        // console.log(1)
     $(this).parent('label').siblings().removeClass('active')
     $(this).parent('label').addClass('active')
})

$(document).on('click','.del_this',function(){
   if($("#ywTable tbody tr").length<2){
        alert("至少保留一行")
   }else{
     $(this).parents('tr').remove();
   }
})
</script>
</body>

</html>